
 <!DOCTYPE HTML>
<html lang="ch">
<head>
  <meta charset="UTF-8">
  
    <title>基于Hexo构建博客并且部署到Github上 | Yuan</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
    
    <meta name="author" content="Luo Yuan">
    

    
    <meta name="description" content="一个简单的Hexo构建博客的入门资料">
<meta property="og:type" content="article">
<meta property="og:title" content="基于Hexo构建博客并且部署到Github上">
<meta property="og:url" content="http://luoyuan800.github.io/2015/06/30/hexo-git/index.html">
<meta property="og:site_name" content="Yuan">
<meta property="og:description" content="一个简单的Hexo构建博客的入门资料">
<meta property="og:locale">
<meta property="article:published_time" content="2015-06-30T00:53:00.000Z">
<meta property="article:modified_time" content="2021-05-27T06:01:36.444Z">
<meta property="article:author" content="Luo Yuan">
<meta name="twitter:card" content="summary">

    
    <link rel="alternative" href="/atom.xml" title="Yuan" type="application/atom+xml">
    
    
    <link rel="icon" href="/img/favicon.ico">
    
    
    <link rel="apple-touch-icon" href="/img/jacman.jpg">
    <link rel="apple-touch-icon-precomposed" href="/img/jacman.jpg">
    
    
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/%02.css">
<link rel="stylesheet" href="/.css">

<meta name="generator" content="Hexo 5.4.0"></head>

  <body>
    <header>
      
<div>
		
			<div id="imglogo">
				<a href="/"><img src="/img/logo.png" alt="Yuan" title="Yuan"/></a>
			</div>
			
			<div id="textlogo">
				<h1 class="site-name"><a href="/" title="Yuan">Yuan</a></h1>
				<h2 class="blog-motto">一点一滴，积累技术</h2>
			</div>
			<div class="navbar"><a class="navbutton navmobile" href="#" title="Menu">
			</a></div>
			<nav class="animated">
				<ul>
					<ul>
					 
						<li><a href="/">Home</a></li>
					
						<li><a href="/archives">Archives</a></li>
					
						<li><a href="/about">About</a></li>
					
					<li>
 					
					<form class="search" action="//google.com/search" method="get" accept-charset="utf-8">
						<label>Search</label>
						<input type="search" id="search" name="q" autocomplete="off" maxlength="20" placeholder="Search" />
						<input type="hidden" name="q" value="site:luoyuan800.github.io">
					</form>
					
					</li>
				</ul>
			</nav>			
</div>
    </header>
    <div id="container">
      <div id="main" class="post" itemscope itemprop="blogPost">
  
	<article itemprop="articleBody"> 
		<header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2015/06/30/hexo-git/" title="基于Hexo构建博客并且部署到Github上" itemprop="url">基于Hexo构建博客并且部署到Github上</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="Luo Yuan" target="_blank" itemprop="author">Luo Yuan</a>
		
  <p class="article-time">
    <time datetime="2015-06-30T00:53:00.000Z" itemprop="datePublished"> Published 2015-06-30</time>
    
  </p>
</header>
	<div class="article-content">
		
		<div id="toc" class="toc-article">
			<strong class="toc-title">Contents</strong>
		
			<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87"><span class="toc-number">1.</span> <span class="toc-text">环境准备</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9E%84%E5%BB%BA%E5%8D%9A%E5%AE%A2%E9%A1%B5%E9%9D%A2"><span class="toc-number">2.</span> <span class="toc-text">构建博客页面</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8D%9A%E5%AE%A2%E9%A3%8E%E6%A0%BC%E8%AE%BE%E7%BD%AE"><span class="toc-number">3.</span> <span class="toc-text">博客风格设置</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%8B%B7%E8%B4%9D%E5%88%AB%E4%BA%BA%E5%B7%B2%E7%BB%8F%E8%AE%BE%E8%AE%A1%E5%A5%BD%E7%9A%84%E9%A3%8E%E6%A0%BC"><span class="toc-number">3.1.</span> <span class="toc-text">拷贝别人已经设计好的风格</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%8D%9A%E5%AE%A2%E7%9A%84theme"><span class="toc-number">3.2.</span> <span class="toc-text">修改博客的theme</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8F%91%E8%A1%A8%E6%88%96%E8%80%85%E7%BC%96%E8%BE%91%E6%96%87%E7%AB%A0"><span class="toc-number">4.</span> <span class="toc-text">发表或者编辑文章</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#title-Hello"><span class="toc-number">5.</span> <span class="toc-text">  title: Hello</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%83%A8%E7%BD%B2%E5%8D%9A%E5%AE%A2%E5%88%B0%E7%BD%91%E7%BB%9C%E4%B8%8A"><span class="toc-number">6.</span> <span class="toc-text">部署博客到网络上</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE%E8%AF%84%E8%AE%BA%E7%B3%BB%E7%BB%9F"><span class="toc-number">7.</span> <span class="toc-text">配置评论系统</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE%E7%AB%99%E5%86%85%E6%90%9C%E7%B4%A2"><span class="toc-number">8.</span> <span class="toc-text">配置站内搜索</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%B7%BB%E5%8A%A0RSS%E5%8A%9F%E8%83%BD"><span class="toc-number">9.</span> <span class="toc-text">添加RSS功能</span></a></li></ol>
		
		</div>
		
		<p>一个简单的Hexo构建博客的入门资料<span id="more"></span></p>
<h2 id="环境准备"><a href="#环境准备" class="headerlink" title="环境准备"></a>环境准备</h2><ol>
<li>注册一个Github账号<br>这一步就忽略不说了</li>
<li>下载Node安装（如果有需要可以配置path路径）<br>Node可以下载对应操作系统的安装版本，安装后会自动设置path</li>
<li>安装hexo<br>执行命令<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ npm install -g hexo</span><br></pre></td></tr></table></figure></li>
<li>初始化hexo<br>创建自定义目录用来存放hexo项目，在这个目录下执行命令：<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo init</span><br></pre></td></tr></table></figure></li>
</ol>
<h2 id="构建博客页面"><a href="#构建博客页面" class="headerlink" title="构建博客页面"></a>构建博客页面</h2><ol>
<li>在之前生成的hexo项目的目录下执行命令：<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo g  <span class="comment"># 这个是命令 hexo generate 的简写</span></span><br></pre></td></tr></table></figure></li>
<li>可以看到在当前目录下生成了一个public的目录，这个目录就是你博客页面</li>
<li>启动本地server查看页面 执行命令： <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable">$hexo</span> s  <span class="comment"># 这个命令是hexo server的简写</span></span><br></pre></td></tr></table></figure></li>
<li>在浏览器输入 localhost:4000查看效果</li>
</ol>
<h2 id="博客风格设置"><a href="#博客风格设置" class="headerlink" title="博客风格设置"></a>博客风格设置</h2><h3 id="拷贝别人已经设计好的风格"><a href="#拷贝别人已经设计好的风格" class="headerlink" title="拷贝别人已经设计好的风格"></a>拷贝别人已经设计好的风格</h3><p>1.1 下载别人写好的风格文件夹并且放到项目目录的themes 目录下面</p>
<p>1.2 然后更改项目根目录下的_config.yml的文件中的 theme: thems_name</p>
<h3 id="修改博客的theme"><a href="#修改博客的theme" class="headerlink" title="修改博客的theme"></a>修改博客的theme</h3><p>2.1 找到你当前使用的theme的文件夹，在其中有一个_config.yml文件。</p>
<p>2.2 打开这个文件进行编辑即可以修改页面布局和一些其他的内容。</p>
<h2 id="发表或者编辑文章"><a href="#发表或者编辑文章" class="headerlink" title="发表或者编辑文章"></a>发表或者编辑文章</h2><ol>
<li>在项目目录的 ./source/_posts 目录下的 *.md文件就是文章内容，可以是用文本编辑器打开编辑</li>
<li>文件的格式：（注意所有冒号后面都要有一个空格）</li>
</ol>
<p>  title: postName #文章页面上的显示名称，可以任意修改，不会出现在URL中<br>  date: 2013-12-02 15:30:16 #文章生成时间，一般不改，当然也可以任意修改<br>  categories: example #分类 可选，设置了的会自动归类<br>  tags: [tag1,tag2,tag3] #文章标签，可空，多标签请用格式，注意:后面有个空格</p>
<hr>
<p>  这里是正文</p>
<ol start="3">
<li>摘要显示可以是用&lt;!--more--&gt;放在作为摘要的文字后面</li>
</ol>
<h2 id="title-Hello"><a href="#title-Hello" class="headerlink" title="  title: Hello"></a>  title: Hello</h2><p>  这里是摘要<!--more--><br>  这里是正文</p>
<h2 id="部署博客到网络上"><a href="#部署博客到网络上" class="headerlink" title="部署博客到网络上"></a>部署博客到网络上</h2><ul>
<li>使用github提供的空间可以部署刚刚用hexo构建的博客：</li>
<li>在github上创建衣和用户名相关的项目（名字格式是固定的）, 例如：luoyuan800.github.io</li>
<li>将刚刚构建的hexo项目下的public文件夹中的都push到git项目中（拷贝后push）</li>
<li>访问 <a href="http://luoyuan800.github.io/">http://luoyuan800.github.io</a> 即可以查看博客。（将其中的luoyuan800换成你的用户名）</li>
<li>如果发现不能访问的话，确认名称的格式，还有git用户中要配置一个已经verify的邮箱。</li>
</ul>
<h2 id="配置评论系统"><a href="#配置评论系统" class="headerlink" title="配置评论系统"></a>配置评论系统</h2><p>默认的静态网页是不提供评论的，而Hexo这个框架搭建的博客默认是可以简单设置使用disqus搭建评论<br>而国内用户没办法是用disqus，可以选择使用多说（duoshuo）。</p>
<ol>
<li>去多说的网站<a target="_blank" rel="noopener" href="http://duoshuo.com/">http://duoshuo.com/</a> 注册一个账号（可以使用第三方QQ微博之类的登录）然后注册一个shortname</li>
<li>我是使用Jacman（Theme）的模块搭建博客的，那么只需要打开这个Theme的文件下面的_config.yml文件，找到其中的#### Comment这一段，然后在对应的duoshuo_shortname后面添加你的shortname就可以加载评论模块了</li>
</ol>
<h2 id="配置站内搜索"><a href="#配置站内搜索" class="headerlink" title="配置站内搜索"></a>配置站内搜索</h2><p>我使用的是jacman主题，这个主题可以简单的配置基于Google，百度， tinysou这个三种站内搜索工具。<br>因为Google访问比较麻烦，百度检索的收录速度超级慢，我选择了tinysou这个工具。</p>
<ul>
<li>打开<a target="_blank" rel="noopener" href="http://tinysou.com/plan.html">tinysou</a></li>
<li>选择立即注册（免费版），用邮箱注册一个账号并且验证</li>
<li>进入控制台创建一个Engines</li>
<li>进入你创建的Engines的管理页面，点击爬虫选项卡，在其中添加博客的域名（luoyuan800.github.io)</li>
<li>打开hexo项目中themes文件夹中的jacman文件夹中的_config.yml文件， 修改一下内容：<br>tinysou_search:     ## <a target="_blank" rel="noopener" href="http://tinysou.com/">http://tinysou.com/</a><br>  enable: true<br>  id: engine key ## e.g. “4ac092ad8d749fdc6293” for your tiny search id</li>
<li>在Hexo项目目录下的sources文件夹下面创建一个search文件夹</li>
<li>在刚刚创建的文件夹下面创建一个index.md文件，其中填写内容<pre><code>  layout: search 
  title: search
  ---
</code></pre>
</li>
</ul>
<h2 id="添加RSS功能"><a href="#添加RSS功能" class="headerlink" title="添加RSS功能"></a>添加RSS功能</h2><p>jacman主题漠然开启RSS模块，不过如果你直接使用点击RSS只会返回404。因为HEXO默认是没有生成RSS文件的</p>
<ul>
<li>安装hexo的rss插件<pre><code class="bash">$ npm install hexo-deployer-git --save
</code></pre>
</li>
<li>编辑项目文件下的_config.yml文件添加如下内容<br>feed:<br> type: atom       #feed 类型 (atom/rss2)<br> path: atom.xml   #rss 路径<br> limit: 20        #在 rss 中最多生成的文章数(0显示所有)</li>
<li>重新构建网站并且上传到你的网站空间<pre><code class="bash">$ hexo g
</code></pre>
</li>
</ul>
<p>注：以上所有修改完成后都需要重新构建项目然后发布public文件下的文件才可以看到效果。</p>
  
	</div>
		<footer class="article-footer clearfix">
<div class="article-catetags">

<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/%E7%BD%91%E7%AB%99-%E5%BC%80%E5%8F%91/">网站-开发</a>
</div>


</div>



	<div class="article-share" id="share">
	
	  <div data-url="http://luoyuan800.github.io/2015/06/30/hexo-git/" data-title="基于Hexo构建博客并且部署到Github上 | Yuan" data-tsina="" class="share clearfix">
	  </div>
	
	</div>


</footer>

   	       
	</article>
	
<nav class="article-nav clearfix">
 
 <div class="prev" >
 <a href="/2015/06/30/cron/" title="Cron 表达式入门">
  <strong>上一篇：</strong><br/>
  <span>
  Cron 表达式入门</span>
</a>
</div>


</nav>

	



</div>  
      <div class="openaside"><a class="navbutton" href="#" title="Show Sidebar"></a></div>

  <div id="toc" class="toc-aside">
  <strong class="toc-title">Contents</strong>
 
 <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87"><span class="toc-number">1.</span> <span class="toc-text">环境准备</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9E%84%E5%BB%BA%E5%8D%9A%E5%AE%A2%E9%A1%B5%E9%9D%A2"><span class="toc-number">2.</span> <span class="toc-text">构建博客页面</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8D%9A%E5%AE%A2%E9%A3%8E%E6%A0%BC%E8%AE%BE%E7%BD%AE"><span class="toc-number">3.</span> <span class="toc-text">博客风格设置</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%8B%B7%E8%B4%9D%E5%88%AB%E4%BA%BA%E5%B7%B2%E7%BB%8F%E8%AE%BE%E8%AE%A1%E5%A5%BD%E7%9A%84%E9%A3%8E%E6%A0%BC"><span class="toc-number">3.1.</span> <span class="toc-text">拷贝别人已经设计好的风格</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%8D%9A%E5%AE%A2%E7%9A%84theme"><span class="toc-number">3.2.</span> <span class="toc-text">修改博客的theme</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8F%91%E8%A1%A8%E6%88%96%E8%80%85%E7%BC%96%E8%BE%91%E6%96%87%E7%AB%A0"><span class="toc-number">4.</span> <span class="toc-text">发表或者编辑文章</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#title-Hello"><span class="toc-number">5.</span> <span class="toc-text">  title: Hello</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%83%A8%E7%BD%B2%E5%8D%9A%E5%AE%A2%E5%88%B0%E7%BD%91%E7%BB%9C%E4%B8%8A"><span class="toc-number">6.</span> <span class="toc-text">部署博客到网络上</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE%E8%AF%84%E8%AE%BA%E7%B3%BB%E7%BB%9F"><span class="toc-number">7.</span> <span class="toc-text">配置评论系统</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE%E7%AB%99%E5%86%85%E6%90%9C%E7%B4%A2"><span class="toc-number">8.</span> <span class="toc-text">配置站内搜索</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%B7%BB%E5%8A%A0RSS%E5%8A%9F%E8%83%BD"><span class="toc-number">9.</span> <span class="toc-text">添加RSS功能</span></a></li></ol>
 
  </div>

<div id="asidepart">
<div class="closeaside"><a class="closebutton" href="#" title="Hide Sidebar"></a></div>
<aside class="clearfix">

  


  
<div class="categorieslist">
	<p class="asidetitle">Categories</p>
		<ul>
		
		  
			<li><a href="/categories/杂物-医学/" title="杂物-医学">杂物-医学<sup>1</sup></a></li>
		  
		
		  
			<li><a href="/categories/编程-Java/" title="编程-Java">编程-Java<sup>13</sup></a></li>
		  
		
		  
			<li><a href="/categories/编程-Linux-Unix/" title="编程-Linux/Unix">编程-Linux/Unix<sup>4</sup></a></li>
		  
		
		  
			<li><a href="/categories/编程-工具/" title="编程-工具">编程-工具<sup>4</sup></a></li>
		  
		
		  
			<li><a href="/categories/编程-网络协议/" title="编程-网络协议">编程-网络协议<sup>1</sup></a></li>
		  
		
		  
			<li><a href="/categories/网站-开发/" title="网站-开发">网站-开发<sup>2</sup></a></li>
		  
		
		</ul>
</div>


  

  <div class="linkslist">
  <p class="asidetitle">Links</p>
    <ul>
        
          <li>
            
            	<a href="https://coderq.com" target="_blank" title="一个面向程序员交流分享的新一代社区">码农圈</a>
            
          </li>
        
          <li>
            
            	<a href="http://wuchong.me" target="_blank" title="Jark&#39;s Blog">Jark&#39;s Blog</a>
            
          </li>
        
    </ul>
</div>

  


  <div class="rsspart">
	<a href="/atom.xml" target="_blank" title="rss">RSS</a>
</div>

  <div class="weiboshow">
  <p class="asidetitle">Weibo</p>
    <iframe width="100%" height="119" class="share_self"  frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?language=&width=0&height=119&fansRow=2&ptype=1&speed=0&skin=9&isTitle=1&noborder=1&isWeibo=0&isFans=0&uid=&verifier=&dpc=1"></iframe>
</div>


</aside>
</div>
    </div>
    <footer><div id="footer" >
	
	<div class="line">
		<span></span>
		<div class="author"></div>
	</div>
	
	
	<section class="info">
		<p> Hello ,I&#39;m Luo Yuan in Zhuhai. <br/>
			Here is my place for knowledge accumulation.</p>
	</section>
	 
	<div class="social-font" class="clearfix">
		
		
		
		
		
		
		
		
		
		
	</div>
			
		

		<p class="copyright">
		Powered by <a href="http://hexo.io" target="_blank" title="hexo">hexo</a> and Theme by <a href="https://github.com/wuchong/jacman" target="_blank" title="Jacman">Jacman</a> © 2021 
		
		<a href="/about" target="_blank" title="Luo Yuan">Luo Yuan</a>
		
		
		</p>
</div>
</footer>
    <script src="/js/jquery-2.0.3.min.js"></script>
<script src="/js/jquery.imagesloaded.min.js"></script>
<script src="/js/gallery.js"></script>
<script src="/js/jquery.qrcode-0.12.0.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){ 
  $('.navbar').click(function(){
    $('header nav').toggleClass('shownav');
  });
  var myWidth = 0;
  function getSize(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
  };
  var m = $('#main'),
      a = $('#asidepart'),
      c = $('.closeaside'),
      o = $('.openaside');
  c.click(function(){
    a.addClass('fadeOut').css('display', 'none');
    o.css('display', 'block').addClass('fadeIn');
    m.addClass('moveMain');
  });
  o.click(function(){
    o.css('display', 'none').removeClass('beforeFadeIn');
    a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn');      
    m.removeClass('moveMain');
  });
  $(window).scroll(function(){
    o.css("top",Math.max(80,260-$(this).scrollTop()));
  });
  
  $(window).resize(function(){
    getSize(); 
    if (myWidth >= 1024) {
      $('header nav').removeClass('shownav');
    }else{
      m.removeClass('moveMain');
      a.css('display', 'block').removeClass('fadeOut');
      o.css('display', 'none');
      
      $('#toc.toc-aside').css('display', 'none');
        
    }
  });
});
</script>

<script type="text/javascript">
$(document).ready(function(){ 
  var ai = $('.article-content>iframe'),
      ae = $('.article-content>embed'),
      t  = $('#toc'),
      ta = $('#toc.toc-aside'),
      o  = $('.openaside'),
      c  = $('.closeaside');
  if(ai.length>0){
    ai.wrap('<div class="video-container" />');
  };
  if(ae.length>0){
   ae.wrap('<div class="video-container" />');
  };
  c.click(function(){
    ta.css('display', 'block').addClass('fadeIn');
  });
  o.click(function(){
    ta.css('display', 'none');
  });
  $(window).scroll(function(){
    ta.css("top",Math.max(140,320-$(this).scrollTop()));
  });
});
</script>


<script type="text/javascript">
$(document).ready(function(){ 
  var $this = $('.share'),
      url = $this.attr('data-url'),
      encodedUrl = encodeURIComponent(url),
      title = $this.attr('data-title'),
      tsina = $this.attr('data-tsina'),
      description = $this.attr('description');
  var html = [
  '<div class="hoverqrcode clearfix"></div>',
  '<a class="overlay" id="qrcode"></a>',
  '<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="article-share-facebook" target="_blank" title="Facebook"></a>',
  '<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="article-share-twitter" target="_blank" title="Twitter"></a>',
  '<a href="#qrcode" class="article-share-qrcode" title="微信"></a>',
  '<a href="http://widget.renren.com/dialog/share?resourceUrl=' + encodedUrl + '&srcUrl=' + encodedUrl + '&title=' + title +'" class="article-share-renren" target="_blank" title="人人"></a>',
  '<a href="http://service.weibo.com/share/share.php?title='+title+'&url='+encodedUrl +'&ralateUid='+ tsina +'&searchPic=true&style=number' +'" class="article-share-weibo" target="_blank" title="微博"></a>',
  '<span title="Share to"></span>'
  ].join('');
  $this.append(html);

  $('.hoverqrcode').hide();

  var myWidth = 0;
  function updatehoverqrcode(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
    var qrsize = myWidth > 1024 ? 200:100;
    var options = {render: 'image', size: qrsize, fill: '#2ca6cb', text: url, radius: 0.5, quiet: 1};
    var p = $('.article-share-qrcode').position();
    $('.hoverqrcode').empty().css('width', qrsize).css('height', qrsize)
                          .css('left', p.left-qrsize/2+20).css('top', p.top-qrsize-10)
                          .qrcode(options);
  };
  $(window).resize(function(){
    $('.hoverqrcode').hide();
  });
  $('.article-share-qrcode').click(function(){
    updatehoverqrcode();
    $('.hoverqrcode').toggle();
  });
  $('.article-share-qrcode').hover(function(){}, function(){
      $('.hoverqrcode').hide();
  });
});   
</script>











<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" media="screen" type="text/css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript">
$(document).ready(function(){ 
  $('.article-content').each(function(i){
    $(this).find('img').each(function(){
      if ($(this).parent().hasClass('fancybox')) return;
      var alt = this.alt;
      if (alt) $(this).after('<span class="caption">' + alt + '</span>');
      $(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox"></a>');
    });
    $(this).find('.fancybox').each(function(){
      $(this).attr('rel', 'article' + i);
    });
  });
  if($.fancybox){
    $('.fancybox').fancybox();
  }
}); 
</script>



<!-- Analytics Begin -->



<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?e6d1f421bbc9962127a50488f9ed37d1";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>



<!-- Analytics End -->

<!-- Totop Begin -->

	<div id="totop">
	<a title="Back to Top"><img src="/img/scrollup.png"/></a>
	</div>
	<script src="/js/totop.js"></script>

<!-- Totop End -->

<!-- MathJax Begin -->
<!-- mathjax config similar to math.stackexchange -->


<!-- MathJax End -->

<!-- Tiny_search Begin -->

<!-- Tiny_search End -->

  </body>
</html>
